package com.telit.firecommand.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.telit.firecommand.entity.CommFireRiskLevel;
import com.telit.firecommand.vo.FireLevelNumVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommFireRiskLevelDao extends BaseMapper<CommFireRiskLevel> {

    int insertBatch(@Param("itemList")List<CommFireRiskLevel> itemList);

    int getByName(@Param("fireSeasonName") String fireSeasonName);

    IPage<CommFireRiskLevel> selectByPage(IPage<CommFireRiskLevel> commFireRiskLevelIPage, @Param("fireSeasonName") String fireSeasonName);

    void updateAllNoRelease();

    void deleteByName(@Param("fireSeasonName") String fireSeasonName);

    void updateReleaseByName(@Param("fireSeasonName") String fireSeasonName,@Param("isRelease") String isRelease);

    String getReleaseFireSeasonName(@Param("districtCode") String districtCode);

    List<String> queryXianInfoByShi(@Param("districtCode") String districtCode, @Param("city") String city);

    @Select("select xian_name from geo_xzqh_xian where xian = #{xian}")
    String getXianName(@Param("xian") String xian);

    List<String> queryXiangInfoByXian(@Param("districtCode") String districtCode,@Param("county") String county);

    @Select("select xiang_name from geo_xzqh_xiang where xiang = #{xiang}")
    String getXiangName(@Param("xiang") String xiang);

    String getLevelByXiang(@Param("districtCode") String districtCode);

    @Select("select xian from geo_xzqh_xian")
    List<String> queryAllXian();

    @Select("select xiang from geo_xzqh_xiang where xian = #{xian}")
    List<String> queryAllXiangByXian(@Param("xian") String xian);

    String getLevelWhetherByXiang(@Param("districtCode") String districtCode,@Param("fireSeasonName") String fireSeasonName);

    List<FireLevelNumVo> getFireLevelNum(@Param("districtCode") String districtCode);
}
